package database.namespace;

import android.app.Activity;
import android.database.Cursor;
import android.os.Bundle;
import android.widget.TextView;

public class DataBaseActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        TextView view = (TextView) findViewById(R.id.texto);
        
        NotesDbAdapter prueba = new NotesDbAdapter(this);
        prueba.open();
        
        prueba.createNote("chao", "chaito");
        
        Cursor pruebaCursor = prueba.fetchAllNotes();
        
        pruebaCursor.moveToNext();
        
        view.setText(pruebaCursor.getString(1)); 
        
        prueba.close();
    }
}